package com.sinosoft.tcmemr.manager.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.sinosoft.tcmemr.dao.AdminUserEntityMapper;
import com.sinosoft.tcmemr.entity.AdminUserEntity;
import com.sinosoft.tcmemr.manager.AdminUserManager;

@Component
public class AdminUserManagerImpl implements AdminUserManager {
	
	@Autowired
	private AdminUserEntityMapper adminUserMapper;
	
	/**
     * 插入管理用户
     * @param record
     * @return
     */
    public boolean insertSelective(AdminUserEntity adminUser){
    	if(adminUser ==null){
			return false;
		}
		adminUserMapper.insertSelective(adminUser);
		return true;
    }
    /**
     * 更新管理员用户
     * @param record
     * @return
     */
    public boolean updateByPrimaryKeySelective(AdminUserEntity adminUser){
    	if(adminUser ==null){
			return false;
		}
    	adminUserMapper.updateByPrimaryKeySelective(adminUser);
    	return true;
    }
    /**
     * 删除用户信息
     * @param id
     * @return
     */
    public boolean deleteByPrimaryKey(Integer id){
    	if ( id == null )
    		return false;
    	adminUserMapper.deleteByPrimaryKey(id);
    	return true;
    }
    
    /**
     * 得到管理员用户信息
     * @param id
     * @return AdminUserEntity
     */
    public AdminUserEntity getByPrimaryKey(Integer id){
    	return adminUserMapper.getByPrimaryKey(id);
    }
    
    
    
}
